import HttpUtils from '../../utils/http.utils';

const urls = {
		'list':globalConfig.apiPath.v1 + 'api/pmat/v1/appversion',
		'addAPP':globalConfig.apiPath.v1 + 'api/pmat/v1/appversion',
    	'updateAPP':globalConfig.apiPath.v1 + 'api/pmat/v1/appversion/',
		'queryByIdAPP':globalConfig.apiPath.v1 + 'api/pmat/v1/appversion/',
		'deleteByAPP':globalConfig.apiPath.v1+'api/pmat/v1/appversion/',
		'uploadapp':globalConfig.apiPath.v1 + 'api/pmat/v1/upload',
		'filters': globalConfig.apiPath + 'common/unit-state-filters',
		'release': globalConfig.apiPath + 'free-units/'
}

let VersionSrv = {

	list: function (params = {}) {
		return HttpUtils.get(urls.list,params);
	},
	addAPP:function (params = {}) {
		return HttpUtils.post(urls.addAPP,params);
    },
    updateAPP:function (params = {}) {
        return HttpUtils.put(urls.updateAPP+params.id,params);
    },
    queryByIdAPP:function (params = {}) {
		return HttpUtils.get(urls.queryByIdAPP+params.id,);
    },
	deleteByAPP:function (params = {}) {
        return HttpUtils.delete(urls.queryByIdAPP+params);
    },
	filters: function (params = {}) {
		return HttpUtils.post(params);
	},
	release: function (params = {}) {
		return HttpUtils.post(params);
	},
	uploadFile:function(params={}){
		return HttpUtils.post(urls.uploadapp,params);
	}

};

export {VersionSrv};
